<?php

namespace app\index\model;

use think\Db;

/**
 * @author xjy
 */
class UserModel
{

    //用户列表
    static public function getUserList($param, $titles = null, $function = null)
    {
        $db = Db::table('user');
        if (!empty($param['name'])) {
            $db->whereOr('name', 'like','%'.$param['name'].'%');
            $db->whereOr('cn_name', 'like','%'.$param['name'].'%');
        }
        $db->order('utime','desc');
        return \app\common\service\ToolService::downOrReturn($db, $param, $titles, $function);
    }
    static public function getWarehouseCountry(){
       return Db::table('base_warehouse')
            ->alias('a')
            ->join('base_company b','b.id=a.base_company_id')
            ->column('b.base_country_name','a.id');
    }

}
